package com.wuhongyu.rabbitmq.producer.conrtoller;


import com.wuhongyu.api.Message;
import com.wuhongyu.rabbitmq.producer.rabbitmq.Producer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/producer")
public class ProducerController {


    @Autowired
    private Producer producer;

    @PostMapping
    public String send(@RequestBody Message message){
        producer.send(message);
        return "ok";
    }
}
